package bufferedStream;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;

public class BufferReAndWr {
	public static void main(String[] args) {
		BufferedReader br=null;
		BufferedWriter bw=null;
		try {
			br=new BufferedReader(new FileReader("C:/my.bmp"));
			bw=new BufferedWriter(new FileWriter("D:/my.bmp"));
			int b=0;
			while((b=br.read())!=-1){
				bw.write(b);
				bw.flush();
			}
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
